home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / LIB / SCRSIZE2.C < prev    next >
C/C++ Source or Header  |  1992-11-27  |  2KB  |  66 lines

  1. /*--------------------------------------------------------------------*/
  2. /*    s c r s i z e 2 .  c                                            */
  3. /*                                                                    */
  4. /*    Report screen size under OS/2                                   */
  5. /*                                                                    */
  6. /*    Copyright (c) 1992 by Kendra Electronic Wonderworks.            */
  7. /*    All rights reserved except those explicitly granted by          */
  8. /*    the UUPC/extended license.                                      */
  9. /*--------------------------------------------------------------------*/
  10.  
  11. /*
  12.  *    $Id: SCRSIZE2.C 1.1 1992/11/27 14:36:10 ahd Exp $
  13.  *
  14.  *    $Log: SCRSIZE2.C $
  15.  * Revision 1.1  1992/11/27  14:36:10  ahd
  16.  * Initial revision
  17.  *
  18.  */
  19.  
  20.  
  21. /*--------------------------------------------------------------------*/
  22. /*                        System include files                        */
  23. /*--------------------------------------------------------------------*/
  24.  
  25. #include <stdio.h>
  26.  
  27. #define INCL_SUB
  28. #define INCL_NOPM
  29. #include <os2.h>
  30.  
  31. /*--------------------------------------------------------------------*/
  32. /*                    UUPC/extended include files                     */
  33. /*--------------------------------------------------------------------*/
  34.  
  35. #include "lib.h"
  36. #include "scrsize.h"
  37.  
  38. /*--------------------------------------------------------------------*/
  39. /*    s c r s i z e                                                   */
  40. /*                                                                    */
  41. /*    Return screen size under OS/2                                   */
  42. /*--------------------------------------------------------------------*/
  43.  
  44. short scrsize( void )
  45. {
  46.    VIOMODEINFO info;
  47.    USHORT result;
  48.    static boolean error = FALSE;
  49.  
  50.    if ( error )
  51.       return PAGESIZE;
  52.  
  53.    info.cb = sizeof info;
  54.    result = VioGetMode( &info, (HVIO) NULL );
  55.  
  56.    if ( result != 0 )
  57.    {
  58.       printmsg(0,"OS/2 error code %d retrieving video information",
  59.                (int) result );
  60.       error = TRUE;
  61.       return PAGESIZE;
  62.    }
  63.  
  64.    return info.row;
  65. } /* scrsize */
  66.